<!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MTB CAT1 Peripheral driver library: Initialization Functions</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen_style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><a href="http://www.cypress.com/"><img alt="Logo" src="IFXCYP_one-line.png"/></a></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">MTB CAT1 Peripheral driver library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__group__gpio__functions__init.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Initialization Functions<div class="ingroups"><a class="el" href="group__group__gpio.html">GPIO         (General Purpose Input Output)</a> &raquo; <a class="el" href="group__group__gpio__functions.html">Functions</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">General Description</h2>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gad61553f65d4e6bd827eb6464a7913461"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__gpio__enums.html#ga0ba12c6f18fa9e356ceea0218beb7259">cy_en_gpio_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__gpio__functions__init.html#gad61553f65d4e6bd827eb6464a7913461">Cy_GPIO_Pin_Init</a> (<a class="el" href="struct_g_p_i_o___p_r_t___type.html">GPIO_PRT_Type</a> *base, uint32_t pinNum, const <a class="el" href="structcy__stc__gpio__pin__config__t.html">cy_stc_gpio_pin_config_t</a> *config)</td></tr>
<tr class="memdesc:gad61553f65d4e6bd827eb6464a7913461"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initializes all pin configuration settings for the specified pin.  <a href="#gad61553f65d4e6bd827eb6464a7913461">More...</a><br /></td></tr>
<tr class="separator:gad61553f65d4e6bd827eb6464a7913461"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaece2166923613cf7abb536d8a05bfd45"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__gpio__enums.html#ga0ba12c6f18fa9e356ceea0218beb7259">cy_en_gpio_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__gpio__functions__init.html#gaece2166923613cf7abb536d8a05bfd45">Cy_GPIO_Port_Init</a> (<a class="el" href="struct_g_p_i_o___p_r_t___type.html">GPIO_PRT_Type</a> *base, const <a class="el" href="structcy__stc__gpio__prt__config__t.html">cy_stc_gpio_prt_config_t</a> *config)</td></tr>
<tr class="memdesc:gaece2166923613cf7abb536d8a05bfd45"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize a complete port of pins from a single init structure.  <a href="#gaece2166923613cf7abb536d8a05bfd45">More...</a><br /></td></tr>
<tr class="separator:gaece2166923613cf7abb536d8a05bfd45"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf57c501727276013d3e8974a9fb7d0a7"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__gpio__functions__init.html#gaf57c501727276013d3e8974a9fb7d0a7">Cy_GPIO_Pin_FastInit</a> (<a class="el" href="struct_g_p_i_o___p_r_t___type.html">GPIO_PRT_Type</a> *base, uint32_t pinNum, uint32_t driveMode, uint32_t outVal, <a class="el" href="group__group__gpio__enums.html#ga678dc02e490d04efdcfec78648899ce4">en_hsiom_sel_t</a> hsiom)</td></tr>
<tr class="memdesc:gaf57c501727276013d3e8974a9fb7d0a7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize the most common configuration settings for all pin types.  <a href="#gaf57c501727276013d3e8974a9fb7d0a7">More...</a><br /></td></tr>
<tr class="separator:gaf57c501727276013d3e8974a9fb7d0a7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gad996e3e1fc44d28611e9b83fc025994b"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__gpio__functions__init.html#gad996e3e1fc44d28611e9b83fc025994b">Cy_GPIO_Port_Deinit</a> (<a class="el" href="struct_g_p_i_o___p_r_t___type.html">GPIO_PRT_Type</a> *base)</td></tr>
<tr class="memdesc:gad996e3e1fc44d28611e9b83fc025994b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reset a complete port of pins back to power on reset defaults.  <a href="#gad996e3e1fc44d28611e9b83fc025994b">More...</a><br /></td></tr>
<tr class="separator:gad996e3e1fc44d28611e9b83fc025994b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga83a06264feed0e1042671a74339ea155"><td class="memItemLeft" align="right" valign="top">__STATIC_INLINE void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__gpio__functions__init.html#ga83a06264feed0e1042671a74339ea155">Cy_GPIO_SetHSIOM</a> (<a class="el" href="struct_g_p_i_o___p_r_t___type.html">GPIO_PRT_Type</a> *base, uint32_t pinNum, <a class="el" href="group__group__gpio__enums.html#ga678dc02e490d04efdcfec78648899ce4">en_hsiom_sel_t</a> value)</td></tr>
<tr class="memdesc:ga83a06264feed0e1042671a74339ea155"><td class="mdescLeft">&#160;</td><td class="mdescRight">Configures the HSIOM connection to the pin.  <a href="#ga83a06264feed0e1042671a74339ea155">More...</a><br /></td></tr>
<tr class="separator:ga83a06264feed0e1042671a74339ea155"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga5f0929f9d81dc941016b55e227c68a69"><td class="memItemLeft" align="right" valign="top">__STATIC_INLINE <a class="el" href="group__group__gpio__enums.html#ga678dc02e490d04efdcfec78648899ce4">en_hsiom_sel_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__gpio__functions__init.html#ga5f0929f9d81dc941016b55e227c68a69">Cy_GPIO_GetHSIOM</a> (<a class="el" href="struct_g_p_i_o___p_r_t___type.html">GPIO_PRT_Type</a> *base, uint32_t pinNum)</td></tr>
<tr class="memdesc:ga5f0929f9d81dc941016b55e227c68a69"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the current HSIOM multiplexer connection to the pin.  <a href="#ga5f0929f9d81dc941016b55e227c68a69">More...</a><br /></td></tr>
<tr class="separator:ga5f0929f9d81dc941016b55e227c68a69"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab0eeafea970eadb4e147ff6d0e3804dc"><td class="memItemLeft" align="right" valign="top">__STATIC_INLINE <a class="el" href="struct_g_p_i_o___p_r_t___type.html">GPIO_PRT_Type</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__gpio__functions__init.html#gab0eeafea970eadb4e147ff6d0e3804dc">Cy_GPIO_PortToAddr</a> (uint32_t portNum)</td></tr>
<tr class="memdesc:gab0eeafea970eadb4e147ff6d0e3804dc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Retrieves the port address based on the given port number.  <a href="#gab0eeafea970eadb4e147ff6d0e3804dc">More...</a><br /></td></tr>
<tr class="separator:gab0eeafea970eadb4e147ff6d0e3804dc"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a id="gad61553f65d4e6bd827eb6464a7913461"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gad61553f65d4e6bd827eb6464a7913461">&#9670;&nbsp;</a></span>Cy_GPIO_Pin_Init()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__gpio__enums.html#ga0ba12c6f18fa9e356ceea0218beb7259">cy_en_gpio_status_t</a> Cy_GPIO_Pin_Init </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_g_p_i_o___p_r_t___type.html">GPIO_PRT_Type</a> *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>pinNum</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structcy__stc__gpio__pin__config__t.html">cy_stc_gpio_pin_config_t</a> *&#160;</td>
          <td class="paramname"><em>config</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initializes all pin configuration settings for the specified pin. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>Pointer to the pin's port register base address</td></tr>
    <tr><td class="paramname">pinNum</td><td>Position of the pin bit-field within the port register</td></tr>
    <tr><td class="paramname">config</td><td>Pointer to the pin config structure base address</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Initialization status</dd></dl>
<dl class="section note"><dt>Note</dt><dd>This function modifies port registers in read-modify-write operations. It is not thread safe as the resource is shared among multiple pins on a port.</dd>
<dd>
When EXT_CLK is source to HF0 and this API is called from application then make sure that the drivemode argument is CY_GPIO_DM_HIGHZ.</dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd><div class="fragment"><div class="line"></div><div class="line">    <a class="code" href="structcy__stc__gpio__pin__config__t.html">cy_stc_gpio_pin_config_t</a> pinConfig = {</div><div class="line">        <span class="comment">/*.outVal =*/</span>       1UL,                    <span class="comment">/* Output = High */</span></div><div class="line">        <span class="comment">/*.driveMode =*/</span>    <a class="code" href="group__group__gpio__drive_modes.html#ga9e554ee7c43ac65a6d48274455b53823">CY_GPIO_DM_STRONG</a>,      <span class="comment">/* Resistive pull-up, input buffer on */</span></div><div class="line">        <span class="comment">/*.hsiom =*/</span>        P0_3_GPIO,              <span class="comment">/* Software controlled pin */</span></div><div class="line">        <span class="comment">/*.intEdge =*/</span>      <a class="code" href="group__group__gpio__interrupt_trigger.html#gafbaa3f5dff9b5689cdb43bb07c7c6fef">CY_GPIO_INTR_RISING</a>,    <span class="comment">/* Rising edge interrupt */</span></div><div class="line">        <span class="comment">/*.intMask =*/</span>      1UL,                    <span class="comment">/* Enable port interrupt for this pin */</span></div><div class="line">        <span class="comment">/*.vtrip =*/</span>        <a class="code" href="group__group__gpio__vtrip.html#ga0eb9d3f41338feae28103e8a8c302ba0">CY_GPIO_VTRIP_CMOS</a>,     <span class="comment">/* CMOS voltage trip */</span></div><div class="line">        <span class="comment">/*.slewRate =*/</span>     <a class="code" href="group__group__gpio__slew_rate.html#gabb43620358101afd1663376cb3ba19b4">CY_GPIO_SLEW_FAST</a>,      <span class="comment">/* Fast slew rate */</span></div><div class="line">        <span class="comment">/*.driveSel =*/</span>     <a class="code" href="group__group__gpio__drive_strength.html#ga203ca4e69600122e76e45dbaa2f013fb">CY_GPIO_DRIVE_FULL</a>,     <span class="comment">/* Full drive strength */</span></div><div class="line">        <span class="comment">/*.vregEn =*/</span>       0UL,                    <span class="comment">/* SIO-specific setting - ignored */</span></div><div class="line">        <span class="comment">/*.ibufMode =*/</span>     0UL,                    <span class="comment">/* SIO-specific setting - ignored */</span></div><div class="line">        <span class="comment">/*.vtripSel =*/</span>     0UL,                    <span class="comment">/* SIO-specific setting - ignored */</span></div><div class="line">        <span class="comment">/*.vrefSel =*/</span>      0UL,                    <span class="comment">/* SIO-specific setting - ignored */</span></div><div class="line">        <span class="comment">/*.vohSel =*/</span>       0UL                     <span class="comment">/* SIO-specific setting - ignored */</span></div><div class="line">    };</div><div class="line"></div><div class="line">    <span class="comment">/* Initialize pin P0.3 */</span></div><div class="line">    <span class="keywordflow">if</span>(<a class="code" href="group__group__gpio__enums.html#gga0ba12c6f18fa9e356ceea0218beb7259ac12fe3dac92e654617ce1a0cda34c0b0">CY_GPIO_SUCCESS</a> != <a class="code" href="group__group__gpio__functions__init.html#gad61553f65d4e6bd827eb6464a7913461">Cy_GPIO_Pin_Init</a>(P0_3_PORT, P0_3_NUM, &amp;pinConfig))</div><div class="line">    {</div><div class="line">        <span class="comment">/* Insert error handling */</span></div><div class="line">    }</div><div class="line"></div></div><!-- fragment --></dd></dl>

</div>
</div>
<a id="gaece2166923613cf7abb536d8a05bfd45"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaece2166923613cf7abb536d8a05bfd45">&#9670;&nbsp;</a></span>Cy_GPIO_Port_Init()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__gpio__enums.html#ga0ba12c6f18fa9e356ceea0218beb7259">cy_en_gpio_status_t</a> Cy_GPIO_Port_Init </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_g_p_i_o___p_r_t___type.html">GPIO_PRT_Type</a> *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structcy__stc__gpio__prt__config__t.html">cy_stc_gpio_prt_config_t</a> *&#160;</td>
          <td class="paramname"><em>config</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initialize a complete port of pins from a single init structure. </p>
<p>The configuration structure used in this function has a 1:1 mapping to the GPIO and HSIOM registers. Refer to the device Technical Reference Manual (TRM) for the register details on how to populate them.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>Pointer to the pin's port register base address</td></tr>
    <tr><td class="paramname">config</td><td>Pointer to the pin config structure base address</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Initialization status</dd></dl>
<dl class="section note"><dt>Note</dt><dd>If using the PSoC Creator IDE, there is no need to initialize the pins when using the GPIO component on the schematic. Ports are configured in Cy_SystemInit() before main() entry.</dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd><div class="fragment"><div class="line">    <span class="comment">/* Scenario: Initialize GPIO port 0:</span></div><div class="line"><span class="comment">     * - 3 pin as input with resistive pull-up and rising edge interrupt;</span></div><div class="line"><span class="comment">     * - 5 pin as output in a strong drive mode with initial state high. */</span></div><div class="line"><span class="preprocessor">    #define PIN_INPUT_NUM   3u</span></div><div class="line"><span class="preprocessor">    #define PIN_OUTPUT_NUM  5u</span></div><div class="line"></div><div class="line"><span class="preprocessor">    #define PIN_HIGH        1u</span></div><div class="line"><span class="preprocessor">    #define INTR_ENABLE     1u</span></div><div class="line"><span class="preprocessor">    #define INTR_CFG_LEN    2u</span></div><div class="line"><span class="preprocessor">    #define PIN_DM_CFG_LEN  4u</span></div><div class="line"></div><div class="line">    <a class="code" href="structcy__stc__gpio__prt__config__t.html">cy_stc_gpio_prt_config_t</a> portConfig = {</div><div class="line">        <span class="comment">/*.out        =*/</span> (PIN_HIGH &lt;&lt; PIN_OUTPUT_NUM),                                 <span class="comment">/* PX.5 output value = 1 */</span></div><div class="line">        <span class="comment">/*.intrMask   =*/</span> (INTR_ENABLE &lt;&lt; PIN_INPUT_NUM),                               <span class="comment">/* PX.3 interrupt enabled */</span></div><div class="line">        <span class="comment">/*.intrCfg    =*/</span> (<a class="code" href="group__group__gpio__interrupt_trigger.html#gafbaa3f5dff9b5689cdb43bb07c7c6fef">CY_GPIO_INTR_RISING</a> &lt;&lt; (PIN_INPUT_NUM * INTR_CFG_LEN)),      <span class="comment">/* PX.3 rising edge interrupt */</span></div><div class="line">        <span class="comment">/*.cfg        =*/</span> ((<a class="code" href="group__group__gpio__drive_modes.html#ga822f7d73072811b69a754d70806247b9">CY_GPIO_DM_PULLUP</a> &lt;&lt; (PIN_INPUT_NUM  * PIN_DM_CFG_LEN)) |   <span class="comment">/* PX.3 resistive pull-up */</span></div><div class="line">                          (<a class="code" href="group__group__gpio__drive_modes.html#ga9e554ee7c43ac65a6d48274455b53823">CY_GPIO_DM_STRONG</a> &lt;&lt; (PIN_OUTPUT_NUM  * PIN_DM_CFG_LEN))),   <span class="comment">/* PX.5 strong drive */</span></div><div class="line">        <span class="comment">/*.cfgIn      =*/</span> 0x00000000u,                                                  <span class="comment">/* PX[7:0] CMOS trip (default value)*/</span></div><div class="line">        <span class="comment">/*.cfgOut     =*/</span> 0x00000000u,                                                  <span class="comment">/* PX[7:0] Fast slew rate, full drive strength (default value) */</span></div><div class="line">        <span class="comment">/*.cfgSIO     =*/</span> 0x00000000u,                                                  <span class="comment">/* PX[7:0] ignored (default value) */</span></div><div class="line">        <span class="comment">/*.sel0Active =*/</span> 0x00000000u,                                                  <span class="comment">/* PX[3:0] Use GPIO HSIOM (default value) */</span></div><div class="line">        <span class="comment">/*.sel1Active =*/</span> 0x00000000u,                                                  <span class="comment">/* PX[7:4] Use GPIO HSIOM (default value) */</span></div><div class="line">    };</div><div class="line"></div><div class="line">    <span class="comment">/* Initialize GPIO port 0 */</span></div><div class="line">    <span class="keywordflow">if</span>(<a class="code" href="group__group__gpio__enums.html#gga0ba12c6f18fa9e356ceea0218beb7259ac12fe3dac92e654617ce1a0cda34c0b0">CY_GPIO_SUCCESS</a> != <a class="code" href="group__group__gpio__functions__init.html#gaece2166923613cf7abb536d8a05bfd45">Cy_GPIO_Port_Init</a>(GPIO_PRT0, &amp;portConfig))</div><div class="line">    {</div><div class="line">        <span class="comment">/* Insert error handling */</span></div><div class="line">    }</div><div class="line"></div></div><!-- fragment --></dd></dl>

</div>
</div>
<a id="gaf57c501727276013d3e8974a9fb7d0a7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaf57c501727276013d3e8974a9fb7d0a7">&#9670;&nbsp;</a></span>Cy_GPIO_Pin_FastInit()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Cy_GPIO_Pin_FastInit </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_g_p_i_o___p_r_t___type.html">GPIO_PRT_Type</a> *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>pinNum</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>driveMode</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>outVal</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__gpio__enums.html#ga678dc02e490d04efdcfec78648899ce4">en_hsiom_sel_t</a>&#160;</td>
          <td class="paramname"><em>hsiom</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initialize the most common configuration settings for all pin types. </p>
<p>These include, drive mode, initial output value, and HSIOM connection.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>Pointer to the pin's port register base address</td></tr>
    <tr><td class="paramname">pinNum</td><td>Position of the pin bit-field within the port register</td></tr>
    <tr><td class="paramname">driveMode</td><td>Pin drive mode. Options are detailed in <a class="el" href="group__group__gpio__drive_modes.html">Pin drive mode</a> macros</td></tr>
    <tr><td class="paramname">outVal</td><td>Logic state of the output buffer driven to the pin (1 or 0)</td></tr>
    <tr><td class="paramname">hsiom</td><td>HSIOM input selection</td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>This function modifies port registers in read-modify-write operations. It is not thread safe as the resource is shared among multiple pins on a port. You can use the <a class="el" href="group__group__syslib__functions.html#gae679f15a1702c159c105b596a8801105" title="Cy_SysLib_EnterCriticalSection disables interrupts and returns a value indicating whether the interru...">Cy_SysLib_EnterCriticalSection()</a> and <a class="el" href="group__group__syslib__functions.html#ga8c16343c075610b2888b0693f972b555" title="Re-enables the interrupts if they were enabled before Cy_SysLib_EnterCriticalSection() was called...">Cy_SysLib_ExitCriticalSection()</a> functions to ensure that <a class="el" href="group__group__gpio__functions__init.html#gaf57c501727276013d3e8974a9fb7d0a7" title="Initialize the most common configuration settings for all pin types. ">Cy_GPIO_Pin_FastInit()</a> function execution is not interrupted.</dd>
<dd>
When EXT_CLK is source to HF0 and this API is called from application then make sure that the drivemode argument is CY_GPIO_DM_HIGHZ.</dd>
<dd>
This doesn't set pull-up resistance value. By default. the pull-up resistance is disabled. To select it, use Cy_GPIO_SetPullupResistance.</dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd><div class="fragment"><div class="line"></div><div class="line">    <span class="comment">/* Quickly initialize pin P0.3 (e.g. quickly set up a test LED) */</span></div><div class="line">    <a class="code" href="group__group__gpio__functions__init.html#gaf57c501727276013d3e8974a9fb7d0a7">Cy_GPIO_Pin_FastInit</a>(P0_3_PORT, P0_3_NUM, <a class="code" href="group__group__gpio__drive_modes.html#ga822f7d73072811b69a754d70806247b9">CY_GPIO_DM_PULLUP</a>, 1UL, P0_3_GPIO);</div><div class="line"></div></div><!-- fragment --></dd></dl>

</div>
</div>
<a id="gad996e3e1fc44d28611e9b83fc025994b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gad996e3e1fc44d28611e9b83fc025994b">&#9670;&nbsp;</a></span>Cy_GPIO_Port_Deinit()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Cy_GPIO_Port_Deinit </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_g_p_i_o___p_r_t___type.html">GPIO_PRT_Type</a> *&#160;</td>
          <td class="paramname"><em>base</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Reset a complete port of pins back to power on reset defaults. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>Pointer to the pin's port register base address</td></tr>
  </table>
  </dd>
</dl>
<dl class="section user"><dt>Function Usage</dt><dd><div class="fragment"><div class="line"></div><div class="line">    <span class="comment">/* Initialize GPIO port 0 */</span></div><div class="line">    (void)<a class="code" href="group__group__gpio__functions__init.html#gaece2166923613cf7abb536d8a05bfd45">Cy_GPIO_Port_Init</a>(GPIO_PRT0, &amp;portConfig);</div><div class="line"></div><div class="line">    <span class="comment">/* Scenario: The port is no longer used or needs to be disabled */</span></div><div class="line"></div><div class="line">    <span class="comment">/* Reset the GPIO port 0 to Power-On-Reset values */</span></div><div class="line">    <a class="code" href="group__group__gpio__functions__init.html#gad996e3e1fc44d28611e9b83fc025994b">Cy_GPIO_Port_Deinit</a>(GPIO_PRT0);</div><div class="line"></div></div><!-- fragment --></dd></dl>

</div>
</div>
<a id="ga83a06264feed0e1042671a74339ea155"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga83a06264feed0e1042671a74339ea155">&#9670;&nbsp;</a></span>Cy_GPIO_SetHSIOM()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__STATIC_INLINE void Cy_GPIO_SetHSIOM </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_g_p_i_o___p_r_t___type.html">GPIO_PRT_Type</a> *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>pinNum</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__gpio__enums.html#ga678dc02e490d04efdcfec78648899ce4">en_hsiom_sel_t</a>&#160;</td>
          <td class="paramname"><em>value</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Configures the HSIOM connection to the pin. </p>
<p>Connects the specified High-Speed Input Output Multiplexer (HSIOM) selection to the pin.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>Pointer to the pin's port register base address</td></tr>
    <tr><td class="paramname">pinNum</td><td>Position of the pin bit-field within the port register</td></tr>
    <tr><td class="paramname">value</td><td>HSIOM input selection</td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>This function modifies a port register in a read-modify-write operation. It is not thread safe as the resource is shared among multiple pins on a port.</dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd><div class="fragment"><div class="line"></div><div class="line">    <span class="comment">/* Retrieve the HSIOM connection to P0.3 */</span></div><div class="line">    <span class="keywordflow">if</span>(P0_3_GPIO == <a class="code" href="group__group__gpio__functions__init.html#ga5f0929f9d81dc941016b55e227c68a69">Cy_GPIO_GetHSIOM</a>(P0_3_PORT, P0_3_NUM))</div><div class="line">    {</div><div class="line">        <span class="comment">/* Connect P0.3 to AMUXA */</span></div><div class="line">        <a class="code" href="group__group__gpio__functions__init.html#ga83a06264feed0e1042671a74339ea155">Cy_GPIO_SetHSIOM</a>(P0_3_PORT, P0_3_NUM, P0_3_AMUXA);</div><div class="line">    }</div><div class="line"></div></div><!-- fragment --></dd></dl>

</div>
</div>
<a id="ga5f0929f9d81dc941016b55e227c68a69"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga5f0929f9d81dc941016b55e227c68a69">&#9670;&nbsp;</a></span>Cy_GPIO_GetHSIOM()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__STATIC_INLINE <a class="el" href="group__group__gpio__enums.html#ga678dc02e490d04efdcfec78648899ce4">en_hsiom_sel_t</a> Cy_GPIO_GetHSIOM </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_g_p_i_o___p_r_t___type.html">GPIO_PRT_Type</a> *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>pinNum</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns the current HSIOM multiplexer connection to the pin. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>Pointer to the pin's port register base address</td></tr>
    <tr><td class="paramname">pinNum</td><td>Position of the pin bit-field within the port register</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>HSIOM input selection</dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd><div class="fragment"><div class="line"></div><div class="line">    <span class="comment">/* Retrieve the HSIOM connection to P0.3 */</span></div><div class="line">    <span class="keywordflow">if</span>(P0_3_GPIO == <a class="code" href="group__group__gpio__functions__init.html#ga5f0929f9d81dc941016b55e227c68a69">Cy_GPIO_GetHSIOM</a>(P0_3_PORT, P0_3_NUM))</div><div class="line">    {</div><div class="line">        <span class="comment">/* Connect P0.3 to AMUXA */</span></div><div class="line">        <a class="code" href="group__group__gpio__functions__init.html#ga83a06264feed0e1042671a74339ea155">Cy_GPIO_SetHSIOM</a>(P0_3_PORT, P0_3_NUM, P0_3_AMUXA);</div><div class="line">    }</div><div class="line"></div></div><!-- fragment --></dd></dl>

</div>
</div>
<a id="gab0eeafea970eadb4e147ff6d0e3804dc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gab0eeafea970eadb4e147ff6d0e3804dc">&#9670;&nbsp;</a></span>Cy_GPIO_PortToAddr()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">__STATIC_INLINE <a class="el" href="struct_g_p_i_o___p_r_t___type.html">GPIO_PRT_Type</a> * Cy_GPIO_PortToAddr </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>portNum</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Retrieves the port address based on the given port number. </p>
<p>This is a helper function to calculate the port base address when given a port number. It is to be used when pin access needs to be calculated at runtime.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">portNum</td><td>Port number</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Base address of the port register structure</dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd><div class="fragment"><div class="line"></div><div class="line">    uint32_t portCnt  = 0UL;</div><div class="line">    uint32_t pinCnt   = 3UL;</div><div class="line">    uint32_t pinState = 1UL;</div><div class="line"></div><div class="line">    <span class="comment">/* Scenario: Calculate the location and state of a pin to control */</span></div><div class="line"></div><div class="line">    <span class="comment">/* Control which pin to set/clear using parameters */</span></div><div class="line">    <a class="code" href="group__group__gpio__functions__gpio.html#ga849c813d6771bf8d3c59b89b28a07bca">Cy_GPIO_Write</a>(<a class="code" href="group__group__gpio__functions__init.html#gab0eeafea970eadb4e147ff6d0e3804dc">Cy_GPIO_PortToAddr</a>(portCnt), pinCnt, pinState);</div><div class="line"></div></div><!-- fragment --></dd></dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part
<div id="nav-path" class="navpath">
    <ul>
        <li class="footer">
            Generated for <b>MTB CAT1 Peripheral driver library</b> by <b>Cypress Semiconductor Corporation</b>.
            All rights reserved.
        </li>
    </ul>
</div>
-->
</body>
</html>
